#include "ObjectPtrSerializer.h"

#include "Object/FindObject.h"

CString CObjectPtrPathSerializer::SerializeToString(RObject *InObject)
{
    if(InObject)
    {
        return InObject->GetPath();
    }
    else
    {
        return U"null";
    }
}

TSharedObjectPtr<RObject> CObjectPtrPathSerializer::DeserializeFromString(const CString &InString)
{
    if(InString==U"null")
    {
        return nullptr;
    }
    else
    {
        TSharedObjectPtr<RObject> Object=FindObject(InString);
        assert(Object && "Object not found");
        return Object;
    }
}
